#include"func.h"
int main(int argc,char* argv[]){
    // /2_pipe_read 1.pipe
    ARGS_CHECK(argc,2);
    //打开管道文件,返回描述符
    int fd = open(argv[1],O_RDONLY);
    //读取文件
    char buf[1024] = {0};
    ssize_t rs = read(fd,buf,sizeof(buf));
    ERROR_CHECK(rs,-1,"read")
    printf("res = %ld,the content is:%s\n",rs,buf);

    return 0;
}
